<%=link_to  '计分测试管理' , :action=>"index"%> >> </p><br /><br/>
<link  href="/stylesheets/tests.css" type="text/css" rel="stylesheet" media="screen">
<%= link_to '创建测试', :controller => "c_tests_manage", :action => "new" %>
<table class="datalist">
  <tr>
    <th scope="col" width="100">测试</th>
    <th scope="col" width="200">说明</th>
    <th scope="col">测试类型</th>
    <th scope="col">解释</th>
    <th scope="col">题目数量</th>
    <th scope="col">启用</th>
    <th colspan="5" scope="col"></th>
  </tr>
  <% 
    i = 0  
    @tests.each do |test| 
  %>
    <% if i%2 == 0 %>
  <tr>
    <% else %>
  <tr  class="altrow">    
    <% end %>
     <%if test.t_type==TEST_TYPE_COUNT %>
    <td><%=h test.name %></td>
    <td><%=h truncate(test.description, 80) %></td>
    <td><%=h test.t_type %></td>
    <td><%= test.norms.size %></td>
    <td><%= test.questions.size %></td>
    <td><%= test.status %></td>
    <td><%= link_to '编辑解释', {:id => test, :action => :new_norm }%></td>
    <td><%= link_to '编辑题目', {:id => test, :action => :new_questions }%></td>
    <td><%= link_to '上线', {:id => test, :action => :finish }%></td>
    <td><%= link_to '修改',  {:id => test, :action => :edit } %></td>
    <td>
      <a onclick="return confirm('确定删除?');" href="/surveys/c_tests_manage/destroy/<%=test.id%>">删除</a>
    </td>
  </tr>
    <% end %>
  <% 
    i += 1
    end 
  %>

</table>

<br/>
<%=will_paginate(@tests ,:prev_label=>'上一页',:next_label=>'下一页',:separator=>" | ") %>
